﻿@model yq.WebModel.Sys.TeamUserListPage
           

@Url.Css("Css/metro/css/list.css")
@Url.Script("Scripts/metro/list.js")
<div id="container" class="container">
    @Html.Action("Navigation", "Home")
           @Html.Action("RowLeft", "PublicReuse", new { Area = "Home" })
    <div id="container_r" class="container_right">
        @Html.Action("HeadTitle", "PublicReuse", new { Area = "Home" })
 
        <div class="icodiv">

    @Html.ActionRoleLink(Model.RoleLinkList["添加成员"], new { teamId = Model.TeamId }, new { @class = "btn btn-warning", onclick = "return $.DialogAjax(this,RefList)", alt = "查看" })

       @Html.ActionRoleLink(Model.RoleLinkList["返回列表"], new {  }, new { @class = "btn btn-info" })
        </div>
    
 <div  class="listdivSmOut">
    @foreach (var info in Model.List)
    {
        <div class="listdivSm">
            <div class="longtxt">@info.Name     </div>
            <div class="op">
                  @Html.ActionRoleLink(Model.RoleLinkList["移除"], new { rowsId = info.RowsId }, new { alt = "将该用户从团队列表移除？", @class = "a-role", onclick = "return $.confimSubmit(this,DelUser)" })
                      <span class="divider">/</span>
                    @if (info.IsAdmin == false)
                    {
                                             
                     @Html.ActionRoleLink(Model.RoleLinkList["设置管理员"], new { rowsId = info.RowsId }, new { alt = "将该用户设置为团队管理员？", @class = "a-role", onclick = "return $.confimSubmit(this,DelUser)" })
                    }
                    else
                    { 
                     @("已是管理员")
                    }
            </div>
        </div>
    }
    @if (Model.List.Count == 0)
    { 
      <div class="listdivSm">
            <div class="longtxt">
                当前还没有团队</div>
            <div class="op">
             @Html.ActionRoleLink(Model.RoleLinkList["添加成员"], new { teamId = Model.TeamId }, new { @class = "btn btn-warning", onclick = "return $.DialogAjax(this,RefList)", alt = "查看" })
</div>
        </div>
       
    }
</div>           
              
@*<div class="divlistFormList" style=" min-height:430px">
    <div>
        <table class="table table-striped tableNew" style="position: relative;">
            <thead>
                <tr>
                   <th style="width:200px">
                        管理员
                    </th>
                    <th style="width: 350px">
                        成员姓名
                    </th>
                    <th style="width: 450px">
                        操作
                    </th>
                </tr>
            </thead>
            <tbody>
                @foreach (var info in Model.List)
                {
                    <tr>
                        <td>
                          @Html.Raw(info.IsAdmin ? "是" : "否")
                        </td>
                        <td>
                            @info.Name
                        </td>

                        <td>
                    @Html.ActionRoleLink(Model.RoleLinkList["移除"], new { rowsId = info.RowsId }, new { alt = "将该用户从团队列表移除？", @class = "a-role", onclick = "return $.confimSubmit(this,DelUser)" })
                    
                    @if (info.IsAdmin == false)
                    {
                                               <span class="divider">/</span>
                     @Html.ActionRoleLink(Model.RoleLinkList["设置管理员"], new { rowsId = info.RowsId }, new { alt = "将该用户设置为团队管理员？", @class = "a-role", onclick = "return $.confimSubmit(this,DelUser)" })
                    }

                        </td>
                    </tr>
                }
                @if (Model.List.Count == 0)
                { 
                    <tr>
                        <td colspan="3" style=" text-align:center" >
                            未能搜索到数据
                        </td>
                    </tr>
                }
            </tbody>
        </table>
    </div>
</div>*@
            <script>
            //移除成功或者设置管理员
            function DelUser()
            {
               $.tips("操作成功",null,2,function (){     window.location=window.location; });
            }

            //刷新页面
            function RefList()
            {
            window.location=window.location;
            }
            </script>     
     
    </div>
</div>
